package com.sec.springcloud.Controller;

import com.sec.springcloud.Feign.FergnServiceClient;
import com.sec.springcloud.pojo.scinfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ConsController {

    @Autowired
    FergnServiceClient service;

    @GetMapping("/cons/getid/{id}")
    public scinfo getid(@PathVariable Long id)
    {
        return this.service.queryId(id);
    }

    @PostMapping("/cons/add/{name}")
    public boolean add(@PathVariable String name)
    {
        return this.service.add(name);
    }

    @GetMapping("/cons/get")
    public List get()
    {
        System.out.println("========>");
        return this.service.query();
    }

    @GetMapping("/get")
    public String geti ()
    {

        return "==================>";
    }

}
